from bs4 import BeautifulSoup

if __name__ == '__main__':
    value = """
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>我的网站</title>
        <link rel="stylesheet" href="styles.css">
    </head>
    <body>
        <header>
        <h1>欢迎来到我的网站</h1>
        <nav>
            <ul>
                <li><a href="#home">首页</a></li>
                <li><a href="#about">关于我们</a></li>
                <li><a href="#services">服务</a></li>
                <li><a href="#contact">联系我们</a></li>
            </ul>
        </nav>
        </header>
        
        <section id="home">
            <h2>首页</h2>
            <p>这是首页内容。</p>
        </section>
        <footer>
            <p>© 2024 我的公司. 保留所有权利。</p>
        </footer>
        <script src="scripts.js"></script>
    </body>
    </html>
    """
    bs = BeautifulSoup(value, "html.parser")
    bs_list = bs.find_all("a")
    for val in bs_list:
        print(val.get("href"))


